package top.lishuoboy.hutool.script;

import cn.hutool.script.ScriptRuntimeException;
import cn.hutool.script.ScriptUtil;

import javax.script.CompiledScript;
import javax.script.ScriptException;

public class ScriptUtilTest {
    public static void main(String[] args) {
        ScriptUtil.eval("print('Script test!');");


        CompiledScript script = ScriptUtil.compile("print('Script test!');");
        try {
            script.eval();
        } catch (ScriptException e) {
            throw new ScriptRuntimeException(e);
        }
    }
}
